﻿#ifndef USERSERVICE_H
#define USERSERVICE_H

#include <QObject>
#include <usernetworkaccessmanager.h>
#include <QInputDialog>

class UserService : public QObject
{
    Q_OBJECT
public:
    explicit UserService(QObject *parent = nullptr);

    void saveUser(QWidget *widget, QString nickName, QString position, QString tel, QString mobile, QString QQ, QString wechat);

    bool inputOperatePassword(QWidget *widget);

    void sendMessage(QWidget *widget, QString mobile);

    void findPassword(
            QWidget *widget,
            QString username,
            QString password1,
            QString password2);

    /**
     * 检查当前用户是否已加入企业
     * @brief checkUserCompany
     * @return
     */
    bool checkUserCompany(QWidget *widget);

signals:
    void sendMessageSuccess(QString resCode);

public slots:

private:
    UserNetworkAccessManager *manager;

    QInputDialog inputDialog;
};

#endif // USERSERVICE_H
